<!DOCTYPE html>
<#include "/ftl/header.ftl">

<#include "/ftl/menu.ftl">

<script type="text/javascript">
    $(document).ready(function() {
        var totalPage = "${pageInfo.pages}";
        var visiblePages = 10;
        if (totalPage == "") {
            totalPage = 0;
            visiblePages = 0;
        }
        if (totalPage == 0) {
            $("#pager").hide();

        }
        if (totalPage != "" && totalPage <= visiblePages) {
            totalPage = Number(totalPage);
            visiblePages = totalPage;
        }
        var currentPage = "${pageInfo.pageNum}";
        if (currentPage == "") {
            currentPage = 1;
        } else {
            currentPage = Number(currentPage);
        }
        if (totalPage == 0 && currentPage > 0) {
            totalPage = 1;
            currentPage = 1;
        }
        //var pageSize = 20;
        var pageSize = "${pageInfo.pageSize}";

        $('#pager').twbsPagination({
            totalPages: totalPage,
            visiblePages: visiblePages,
            prev: "«",
            next: "»",
            startPage: currentPage,
            version: '1.1',
            onPageClick: function (event, page) {
                if (page == currentPage) {
                    return;
                }
                $("#pageNum").val(page);
                $("#pageSize").val(pageSize);

                $("#formData").submit();
                // alert($(this));
                //$('#page-content').text('Page ' + page);
            }


        });

        $("#btnSearch").on("click", function () {
            $("#formData").submit();
        });
    });
</script>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-12">
            <ol class="breadcrumb">
                <li>会员管理</li>
                <li>订单管理</li>
                <li class="active">订单详情</li>
            </ol>
        </div>
    </div>

    <div class="row">
        <div class="block">
            <form id="formData" >
                <input type="hidden" name="pageSize" id="pageSize"  />
                <input type="hidden" name="pageNum" id="pageNum" />

                <div class="form-row">
                    <div class="col-md-4">
                        <div class="col-md-3">订单</div>
                        <div class="col-md-5">
                            <input type="text" class="form-control" id="ordernum" name="ordernum" value="${ordernum!}" />
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="col-md-3">手机</div>
                        <div class="col-md-5">
                            <input type="text" class="form-control" id="phone" name="phone" value="${phone!}" />
                        </div>
                    </div>
                    <!--  <div class="col-md-3">
                      <div class="col-md-3">分类</div>
                      <div class="col-md-5">
                          <input type="text" class="form-control" id="category" name="category" value="${category!}" placeholder="型号"/>
                      </div>
                  </div>-->
                    <div class="col-md-4">
                        <div class="col-md-4"></div>
                        <div>
                            <button class="btn btn-default btn-clean" id="btnSearch" type="button" >搜索</button>

                        </div>
                    </div>
                </div>

            </form>

        </div>
         </div>

            <div class="col-md-12">
            <div class="content">
                <table class="table table-bordered table-striped table-hover">
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>订单号</th>
                        <th>手机号</th>
                        <th>下单时间</th>
                        <th>付款时间</th>
                        <th>付款金额</th>
                    </tr>
                    </thead>
                    <tbody>
                    <#if orderList??>
                    <#list orderList as order>
                    <tr>
                        <td>${order_index+1}</td>
                        <td>${order.orderNum!}</td>
                        <td><#if order.userInfo??>${order.userInfo.phone!}</#if> </td>
                        <td>${(order.createDate?string("yyyy-MM-dd hh:mm:ss"))!}</td>
                        <td>${(order.payDate?string("yyyy-MM-dd hh:mm:ss"))!}</td>
                        <td>${order.payPrice!}</td>
                     </tr>
                    </#list>
                </#if>
                </tbody>

                </table>
            </div>
            <div class="text-center">
                <ul id="pager"></ul>
            </div>
        </div>
    </div>

    </div>
</div>

</body>
</html>